Teacher Version

Hero Image
Hero Image

Obstacle Detecting Until Black Line

Modify the Obstacle Detection program you wrote so that it will move safely until the Color Sensor detects a red line on the table, rather than until the robot has traveled certain number of rotations. The obstacle detecting behavior of the program should stay the same. Instead of stopping after the robot has traveled four rotations, program the robot to keep traveling until its Color Sensor detects a black line.

Virtual Robot: DetectUntilBlackVR.rbg

Physical Robot: DetectUntilBlack.rbg

Quick Tips

There is a Sensor set in the If/Else conditional block, and one set in the repeatUntil Loop. Which one controls the "end of behavior"?

ClosedClick here to reveal the answer.

The repeatUntil Loop.

© 2016 Robomatter, Inc.

Portions of this product are manufactured under license from Carnegie Mellon University.